package system_storage_service

import (
	"gitee.com/Luna-CY/Golang-Project-Template/internal/context"
	"gitee.com/Luna-CY/Golang-Project-Template/internal/errors"
	"gitee.com/Luna-CY/Golang-Project-Template/internal/interface/dao"
	"gitee.com/Luna-CY/Golang-Project-Template/model"
)

func (cls *Storage) BatchGetObjectByCondition(ctx context.Context, options ...dao.SystemObjectOption) ([]*model.SystemObject, errors.Error) {
	if 0 == len(options) {
		return nil, nil
	}

	var objects, err = cls.object.BatchTakeSystemObjectByCondition(ctx, options...)
	if nil != err {
		return nil, err.Relation(errors.ErrorServerInternalError("ISSS_GE.S_GE.BGOBC_ON.204316", "查询对象失败"))
	}

	return objects, nil
}
